package chapter7.quarter2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Date;

public class ObjectInputStreamTest {
    public static void main(String[] args) {
        try {
            FileInputStream f=new FileInputStream("date.ser");
            ObjectInputStream s=new ObjectInputStream(f);

            Date d=(Date)s.readObject();
            s.close();
            f.close();

            System.out.println("date serialized at "+d);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
